<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>个人信息</title>
		<meta name="viewport" content="width=device-width, initial-scale=1,maximum-scale=1,user-scalable=no">
		<meta name="apple-mobile-web-app-capable" content="yes">
		<meta name="apple-mobile-web-app-status-bar-style" content="black">
		<link rel="shortcut icon" href="__IMG__/favicon.ico" />
		<link rel="bookmark" href="__IMG__/favicon.ico" type="image/x-icon"/>
		<script src="__JS__/mui.min.js"></script>
		<link rel="stylesheet" href="__CSS__/mui.min.css">
		<link rel="stylesheet" type="text/css" href="__CSS__/common.css"/>
		<link rel="stylesheet" type="text/css" href="__CSS__/index.css"/>
		<script type="text/javascript" charset="utf-8">
	      	mui.init();
       </script>
	<body>
		<header class="mui-bar mui-bar-nav">
		    <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
		    <h1 class="mui-title">个人信息</h1>
		</header>
		<div class="mui-content">
		    <div class="mui-page-content">
				<div class="">
					<ul class="mui-table-view">
						<li class="mui-table-view-cell" id="my_head">
							<a  class="mui-navigate-right">头像
							<span class="mui-pull-right user_box1">
								<img class="width_100" style='border-radius: 50%' id="change_head" src="{$data.head|default='__IMG__/user_head.png'}"/>
							</span>
						</a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">昵称<span class="mui-pull-right" onclick="aa(this,'nickname')">{$data.nickname}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a >账号<span class="mui-pull-right">{$data.mobile}</span></a>
						</li>
					</ul>
					<ul class="mui-table-view mg_top10">
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">QQ<span class="mui-pull-right" onclick="aa(this,'qq')">{$data.qq|default="无"}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">微信<span class="mui-pull-right" onclick="aa(this,'wx')" >{$data.wx|default="无"}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">支付宝<span class="mui-pull-right" onclick="aa(this,'alipay')">{$data.alipay|default="无"}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">姓名<span class="mui-pull-right" onclick="aa(this,'true_name')">{$data.true_name|default="无"}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">银行卡<span class="mui-pull-right" onclick="aa(this,'bank')">{$data.bank|default="无"}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a">开户支行<span class="mui-pull-right" onclick="aa(this,'branch_bank')">{$data.branch_bank|default="无"}</span></a>
						</li>
						<li class="mui-table-view-cell">
							<a class="spring_box2_a"> 银行卡号<span class="mui-pull-right" onclick="aa(this,'bank_card')">{$data.bank_card|default="无"}</span></a>
						</li>
					</ul>
				</div>
			</div>
		</div>
		<div class="spring_user">
			<ul class="mui-table-view">
				<li class="mui-table-view-cell text-center">
					 <span class="file_p text-center" id="btn_logo">
						<label for="cameraInput1">相机/相册</label>
						<input accept="image/*" type="file" id="cameraInput1" hidden="hidden">
						<img height="50px"   id="logo" src=""/><br />
						<input type="hidden" name="hui" id="hui" value=""/>
					</span>
				</li>
				<li class="mui-table-view-cell text-center">
					<a href="javascript:void(0);" class="blue padding_lr10" onclick="cc()">确定</a>
				</li>
			</ul>

		</div>
		<div class="spring_box2">
			<div class="padding_10">
				<input type="text" name="" id="my" value="" />
			</div>
			<div class="padding_10 clearfix">
				<div class="right">
					<a href="javascript:void(0);" class="red1 padding_lr10 cancel_a">取消</a>
					<a href="javascript:void(0);" class="blue padding_lr10" onclick="bb()">确定</a>
				</div>
			</div>
		</div>
		<div class="overlay"></div>
	</body>
		<script src="__JS__/layer.js" ></script>
		<script src="__JS__/rooms.js" ></script>
		<script src="__JS__/jquery-1.7.1.min.js" ></script>
		<script src="__JS__/index.js" ></script>
		<script type="text/javascript" src="__JSA__/Plupload/plupload.full.min.js"></script>
		<script type="text/javascript">
			var ids = new Array("my_head");
			$.each(ids,function(i,n){
				var self = this.toString();
				var uploader_avatar = new plupload.Uploader({
					runtimes: 'gears,html5,html4,silverlight,flash', //上传插件初始化选用那种方式的优先级顺序
					browse_button: self, // 上传按钮
					url: "{:url('upload_head')}", //远程上传地址
					flash_swf_url: '__DTSC__/Moxie.swf',//flash文件地址
					silverlight_xap_url: '__DTSC__/Moxie.xap', //silverlight文件地址
					filters: {
						max_file_size: '100mb', //最大上传文件大小（格式100b, 10kb, 10mb, 1gb）
						mime_types: [//允许文件上传类型
							{title: "files", extensions: "jpg,png,gif,jpeg"}
						]
					},
					multi_selection: false, //true:ctrl多文件上传, false 单文件上传
					init: {
						FilesAdded: function(up, files) { //文件上传前
							uploader_avatar.start();
						},
						UploadProgress: function(up, file) { //上传中，显示进度条
							var percent = file.percent;
							$("#" + file.id).find('.bar').css({"width": percent + "%"});
							$("#" + file.id).find(".percent").text(percent + "%");

						},
						FileUploaded: function(up, file, info) { //文件上传成功的时候触发
							var data = eval("(" + info.response + ")");//解析返回的json数据
							var pic  = data.pic;
							if(data.status == 1){
							    $('#change_head').attr('src',pic);
                                my_error("修改成功");
							}else{
                                my_error("修改失败");
							}
						},
						Error: function(up, err) { //上传出错的时候触发
							alert(err.message);
						}
					}
				});
				uploader_avatar.init();

			});

		</script>
	    <script>
			function aa(obj,name) {
                $('#my').attr("name","");
                $('#my').attr("value","");
				var value = $(obj).html();
				$('#my').attr("name",name);
				$('#my').attr("value",value);
            }
            function bb() {
			    var name  =  $('#my').attr("name");
                var value =  $('#my').attr("value");
                $.ajax({
                    type: "post",
                    url: "{:url('mine/edit_personal')}",
                    data: {'name':name,'value':value},
                    dataType: "json",
                    async: false,
                    success: function (data) {
                        var ret = data.ret;
                        if (ret == '200') {
                            location.reload();
                        }else{
                            my_error("修改失败");
						}
                    }
                });

            }
		</script>

</html>
